﻿package mortal.game.view.chat.chatPanel
{
    import Message.Public.*;
    import com.gengine.global.*;
    import com.gengine.utils.*;
    import com.gengine.utils.pools.*;
    import com.mui.controls.*;
    import com.mui.core.*;
    import extend.language.*;
    import fl.events.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.text.*;
    import flash.text.engine.*;
    import flash.utils.*;
    import mortal.common.*;
    import mortal.common.swfPlayer.*;
    import mortal.common.swfPlayer.data.*;
    import mortal.game.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.scene3D.ai.*;
    import mortal.game.utils.*;
    import mortal.game.view.chat.*;
    import mortal.game.view.chat.chatViewData.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.menu.*;
    import mortal.game.view.common.tooltip.*;
    import mortal.game.view.common.tooltip.tool.*;
    import mortal.game.view.guide.*;
    import mortal.game.view.signUp.util.*;
    import mortal.game.view.task.data.*;
    import mortal.mvc.core.*;

    public class ChatCell extends Object
    {
        private var _cellData:ChatCellData;
        private var _cellContentElement:ContentElement;
        private var _elementFormat:ElementFormat;
        private var _dipatcher:EventDispatcher;
        private var _swfPlayer:SWFPlayer;
        private static var _playerOpList:ListMenu;
        private static var _currnetCell:ChatCell;
        private static var _toolTip:Tooltip;
        public static var chatCellDic:Dictionary = new Dictionary();
        private static var _closeBtn:GButton;
        private static var _spTooltipContainer:Sprite = new Sprite();

        public function ChatCell()
        {
            return;
        }// end function

        public function init(param1:ChatCellData) : void
        {
            this._cellData = param1;
            this._elementFormat = param1.elementFormat ? (param1.elementFormat) : (new ElementFormat());
            this._dipatcher = new EventDispatcher();
            if (!_playerOpList)
            {
                _playerOpList = new ListMenu();
                _playerOpList.width = 86;
                _playerOpList.visible = false;
                _playerOpList.list.setStyle("cellRenderer", PlayerMenuCellRenderer);
                _playerOpList.list.drawNow();
                _playerOpList.list.addEventListener(ListEvent.ITEM_CLICK, this.playerOpItemSelect);
            }
            this.create();
            if (this._cellContentElement)
            {
                chatCellDic[this._cellContentElement] = this;
            }
            return;
        }// end function

        private function create() : void
        {
            var _loc_1:GImageBitmap = null;
            var _loc_2:Sprite = null;
            var _loc_3:ChatBitmap = null;
            var _loc_4:GBitmap = null;
            var _loc_5:GBitmap = null;
            switch(this._cellData.type)
            {
                case CellDataType.LOADINGIMAGE:
                {
                    _loc_1 = UIFactory.gImageBitmap(this._cellData.className, 0, 0);
                    _loc_2 = new Sprite();
                    _loc_2.addChild(_loc_1);
                    this._cellContentElement = new GraphicElement(_loc_2, this._cellData.data.width, this._cellData.data.height, this._elementFormat, this._dipatcher);
                    this.setMouseCanClick();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.openVIPHandler);
                    break;
                }
                case CellDataType.IMAGE:
                {
                    _loc_3 = new ChatBitmap(GlobalClass.getBitmapData(this._cellData.className));
                    this._cellContentElement = new GraphicElement(_loc_3, _loc_3.width, _loc_3.height, this._elementFormat);
                    break;
                }
                case CellDataType.FlyBootEvent:
                {
                    _loc_4 = UIFactory.gBitmap(ImagesConst.MapBtnFlyBoot_upSkin);
                    this._cellContentElement = new GraphicElement(_loc_4, 18, 18, this._elementFormat, this._dipatcher);
                    (this._cellContentElement as GraphicElement).graphic.filters = [];
                    this.setMouseCanClick();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.flyBootEventHandler);
                    break;
                }
                case CellDataType.RumorFly:
                {
                    _loc_4 = UIFactory.gBitmap(ImagesConst.MapBtnFlyBoot_upSkin);
                    this._cellContentElement = new GraphicElement(_loc_4, 18, 18, this._elementFormat, this._dipatcher);
                    (this._cellContentElement as GraphicElement).graphic.filters = [];
                    this.setMouseCanClick();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.flyToMapPositionHandler);
                    break;
                }
                case CellDataType.MovieClip:
                {
                    this._swfPlayer = UIFactory.getUICompoment(SWFPlayer);
                    this._swfPlayer.timeRate = 2;
                    this._swfPlayer.move(0, 0);
                    this._swfPlayer.load(this._cellData.className + ".swf", ModelType.NormalSwf, null);
                    this._cellContentElement = new GraphicElement(this._swfPlayer, 24, 24, this._elementFormat);
                    (this._cellContentElement as GraphicElement).graphic.filters = [];
                    break;
                }
                case CellDataType.VIPFace:
                {
                    this._swfPlayer = UIFactory.getUICompoment(SWFPlayer);
                    this._swfPlayer.timeRate = 2;
                    this._swfPlayer.move(22, 30);
                    this._swfPlayer.load(this._cellData.className + ".swf", ModelType.NormalSwf, null);
                    this._cellContentElement = new GraphicElement(this._swfPlayer, 45, 45, this._elementFormat);
                    (this._cellContentElement as GraphicElement).graphic.filters = [];
                    break;
                }
                case CellDataType.GENERAL:
                {
                    this._cellContentElement = new TextElement(this._cellData.text, this._elementFormat, null);
                    break;
                }
                case CellDataType.EQUIPMENT:
                {
                    this._cellContentElement = new TextElement(this._cellData.text, this._elementFormat, this._dipatcher);
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showToolTipHandler);
                    this.setMouseCanClick();
                    break;
                }
                case CellDataType.RumorItem:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showToolTipHandler);
                    break;
                }
                case CellDataType.PET:
                {
                    this._cellContentElement = new TextElement(this._cellData.text, this._elementFormat, this._dipatcher);
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showPetHandler);
                    this.setMouseCanClick();
                    break;
                }
                case CellDataType.PLAYER:
                {
                    this._cellContentElement = new TextElement(this._cellData.text, this._elementFormat, this._dipatcher);
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showPlayerOperate);
                    this.setMouseCanClick();
                    break;
                }
                case CellDataType.RumorPlayer:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showPlayerOperate);
                    break;
                }
                case CellDataType.Charge:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickCharge);
                    break;
                }
                case CellDataType.RumorTran:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.gotoTran);
                    break;
                }
                case CellDataType.RumorTreasure:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.openTreasure);
                    break;
                }
                case CellDataType.RumorActive:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.openActive);
                    break;
                }
                case CellDataType.EnterGuildManor:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.enterMyGuildManor);
                    break;
                }
                case CellDataType.CAMP:
                {
                    this._cellContentElement = new TextElement(this._cellData.text, this._elementFormat, null);
                    break;
                }
                case CellDataType.LINK:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.linkToUrlHandler);
                    break;
                }
                case CellDataType.RedPacket:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.getRedPacketHandler);
                    break;
                }
                case CellDataType.FastApplyToGUILD:
                {
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.applyToGuildHandler);
                    this.setLink();
                    break;
                }
                case CellDataType.RumorGuild:
                {
                    this.setLink();
                    break;
                }
                case CellDataType.RumorGuild1:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showGuildMsg);
                    break;
                }
                case CellDataType.RumorCopy:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.gotoCopyHandler);
                    break;
                }
                case CellDataType.RumorMapPoint:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.gotoMapPositionHandler);
                    break;
                }
                case CellDataType.GotoEscort:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.gotoEscortHandler);
                    break;
                }
                case CellDataType.FlyEscort:
                {
                    _loc_5 = UIFactory.gBitmap(ImagesConst.MapBtnFlyBoot_upSkin);
                    this._cellContentElement = new GraphicElement(_loc_5, 18, 18, this._elementFormat, this._dipatcher);
                    (this._cellContentElement as GraphicElement).graphic.filters = [];
                    this.setMouseCanClick();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.flyEscortHandler);
                    break;
                }
                case CellDataType.RumorNPC:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.gotNPCHandler);
                    break;
                }
                case CellDataType.RumorPet:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showRumorPetHandler);
                    break;
                }
                case CellDataType.RumorApplyToTeam:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.applyToTeamHandler);
                    break;
                }
                case CellDataType.CornucopiaBless:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.cornucopiaBlessHandler);
                    break;
                }
                case CellDataType.RumorJewelAdvance:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.jewelAdvanceHandler);
                    break;
                }
                case CellDataType.GOTOGUILDBOSS:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.goToGuildBossHandler);
                    break;
                }
                case CellDataType.GroupIWantSignUp:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickIWantSignUpHandler);
                    break;
                }
                case CellDataType.GOTOGUILDROBCITYONE:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.goToGuildRobCityOneCopyHandler);
                    break;
                }
                case CellDataType.GOTOGUILDELITE:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.goToGuildElite);
                    break;
                }
                case CellDataType.GUILDGROUP:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.enterGuildGroup);
                    break;
                }
                case CellDataType.EnterGuildAltar:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.enterGuildAltarHandler);
                    break;
                }
                case CellDataType.EnterGuildPasture:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.enterGuildPastureHandler);
                    break;
                }
                case CellDataType.EnterGuildDefense:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.enterGuildDefenseHandler);
                    break;
                }
                case CellDataType.RumorEXPDICE:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.showExpdiceHandler);
                    break;
                }
                case CellDataType.RumorOPENUI:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.openUIHandler);
                    break;
                }
                case CellDataType.MarketWantBuy:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickMarketQickBuy);
                    break;
                }
                case CellDataType.MarketWantSell:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickMarketQickBuy);
                    break;
                }
                case CellDataType.WatchVideo:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickWatchVideo);
                    break;
                }
                case CellDataType.Islandpos:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClicIslandpos);
                    break;
                }
                case CellDataType.GUILDTASK_GET:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickGuildTaskGet);
                    break;
                }
                case CellDataType.GUILDTASK_ASK_SHARE:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickGuildTaskAskShare);
                    break;
                }
                case CellDataType.OPENVIEW:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickOpenUI);
                    break;
                }
                case CellDataType.OBBATTLE:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickOBBattle);
                    break;
                }
                case CellDataType.BATTLEBYGUILD:
                {
                    this.setLink();
                    this._dipatcher.addEventListener(MouseEvent.CLICK, this.onClickBattleByGuild);
                    break;
                }
                default:
                {
                    this._cellContentElement = new TextElement(this._cellData.text, this._elementFormat, null);
                    break;
                    break;
                }
            }
            return;
        }// end function

        private function setLink() : void
        {
            var _loc_1:TextField = null;
            var _loc_2:TextFormat = null;
            _loc_1 = new TextField();
            _loc_1.autoSize = TextFieldAutoSize.LEFT;
            _loc_1.multiline = true;
            _loc_2 = new GTextFormat();
            _loc_2.color = this._elementFormat.color;
            _loc_2.underline = true;
            _loc_2.size = this._elementFormat.fontSize;
            _loc_2.letterSpacing = this._elementFormat.trackingLeft;
            _loc_1.defaultTextFormat = _loc_2;
            _loc_1.text = this._cellData.text;
            this._cellContentElement = new GraphicElement(_loc_1, _loc_1.width, _loc_1.height, this._elementFormat, this._dipatcher);
            this.setMouseCanClick();
            return;
        }// end function

        private function setMouseCanClick() : void
        {
            this._dipatcher.addEventListener(MouseEvent.MOUSE_OVER, this.mouseStyleHandler);
            this._dipatcher.addEventListener(MouseEvent.MOUSE_OUT, this.mouseStyleHandler);
            return;
        }// end function

        private function mouseStyleHandler(event:MouseEvent) : void
        {
            if (event.type == MouseEvent.MOUSE_OVER)
            {
                CursorManager.showCursor(CursorManager.BUTTON);
            }
            if (event.type == MouseEvent.MOUSE_OUT)
            {
                CursorManager.hideCursor();
            }
            return;
        }// end function

        private function onMCAddToStage(event:Event) : void
        {
            var _loc_2:* = event.currentTarget as MovieClip;
            _loc_2.play();
            return;
        }// end function

        private function onMCRemoveFromStage(event:Event) : void
        {
            var _loc_2:* = event.currentTarget as MovieClip;
            _loc_2.stop();
            return;
        }// end function

        private function linkToUrlHandler(event:Event) : void
        {
            BrowerUtil.getUrl(this._cellData.linkUrl);
            return;
        }// end function

        private function getRedPacketHandler(event:Event) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.RedPackGet, this._cellData.data));
            return;
        }// end function

        private function applyToGuildHandler(event:Event) : void
        {
            var onCloseGuildApply:Function;
            var guildName:String;
            var e:* = event;
            onCloseGuildApply = function (param1:int) : void
            {
                var _loc_2:int = 0;
                if (param1 == Alert.YES)
                {
                    _loc_2 = int(_cellData.data);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GUILD_APPLY_BY_ROLE, _loc_2));
                }
                return;
            }// end function
            ;
            if (Cache.instance.role.entityInfo.level >= GameDefConfig.instance.getSystemOpenLevel(4))
            {
                if (Cache.instance.guild.hasGuild)
                {
                    guildName = Cache.instance.guild.selfGuildInfo.baseInfo.guildName;
                    Alert.show(Language.getStringByParam(21353, guildName), null, Alert.YES | Alert.NO, null, onCloseGuildApply);
                }
                else
                {
                    this.onCloseGuildApply(Alert.YES);
                }
            }
            else
            {
                MsgManager.showRollTipsMsg(Language.getStringByParam(21354, GameDefConfig.instance.getSystemOpenLevel(4)));
            }
            return;
        }// end function

        private function gotoCopyHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function gotoMapPositionHandler(event:MouseEvent) : void
        {
            var _loc_2:* = this._cellData.data["mapId"];
            var _loc_3:* = this._cellData.data["mapX"];
            var _loc_4:* = this._cellData.data["mapY"];
            var _loc_5:* = new Point(_loc_3, _loc_4);
            GuideEffect.isShowPath = true;
            AIManager.onAIControl(AIType.GoToOtherMap, Game.mapInfo.mapId, _loc_2, _loc_5);
            return;
        }// end function

        private function openVIPHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function flyBootEventHandler(event:MouseEvent) : void
        {
            var _loc_2:* = this._cellData.data["eventName"];
            var _loc_3:* = this._cellData.data["data"];
            Dispatcher.dispatchEvent(new DataEvent(_loc_2, _loc_3));
            return;
        }// end function

        private function flyToMapPositionHandler(event:MouseEvent) : void
        {
            var _loc_2:* = this._cellData.data["mapId"];
            var _loc_3:* = this._cellData.data["mapX"];
            var _loc_4:* = this._cellData.data["mapY"];
            var _loc_5:* = new SPassTo();
            _loc_5.mapId = _loc_2;
            var _loc_6:* = new SPoint();
            _loc_6.x = _loc_3;
            _loc_6.y = _loc_4;
            _loc_5.toPoint = _loc_6;
            Dispatcher.dispatchEvent(new DataEvent(EventName.FlyBoot, _loc_5));
            return;
        }// end function

        private function gotoEscortHandler(event:MouseEvent) : void
        {
            TaskUtil.linkTask(Cache.instance.task.getTaskInfoByGroup(ETaskGroup._ETaskGroupEscort));
            return;
        }// end function

        private function flyEscortHandler(event:MouseEvent) : void
        {
            TaskUtil.linkTask(Cache.instance.task.getTaskInfoByGroup(ETaskGroup._ETaskGroupEscort), true);
            return;
        }// end function

        private function gotNPCHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function showPlayerOperate(event:MouseEvent) : void
        {
            var _loc_2:* = event.target as DisplayObject;
            if (_loc_2.parent)
            {
                _currnetCell = this;
                LayerManager.topLayer.addChild(_playerOpList);
                _playerOpList.dataProvider = PlayerMenuConst.getEnabeldAttri(PlayerMenuConst.ChatOpMenu, _currnetCell.cellData.data as SMiniPlayer);
                if (_playerOpList.dataProvider.length > 0)
                {
                    _playerOpList.show(event.stageX, event.stageY - _playerOpList.height, LayerManager.topLayer);
                    Global.stage.addEventListener(MouseEvent.CLICK, this.stageClickHandler);
                }
                else
                {
                    _playerOpList.hide();
                }
            }
            event.stopImmediatePropagation();
            return;
        }// end function

        private function onClickCharge(event:MouseEvent) : void
        {
            return;
        }// end function

        private function showGuildOperate(event:MouseEvent) : void
        {
            return;
        }// end function

        private function showGuildMsg(event:MouseEvent) : void
        {
            return;
        }// end function

        private function gotoTran(event:MouseEvent) : void
        {
            return;
        }// end function

        private function openTreasure(event:MouseEvent) : void
        {
            return;
        }// end function

        private function openActive(event:MouseEvent) : void
        {
            return;
        }// end function

        private function enterMyGuildManor(event:MouseEvent) : void
        {
            return;
        }// end function

        private function stageClickHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function playerOpItemSelect(event:ListEvent) : void
        {
            PlayerMenuConst.Opearte(_playerOpList.list.dataProvider.getItemAt(event.index)["label"], _currnetCell.cellData.data as SMiniPlayer);
            return;
        }// end function

        private function showToolTipHandler(event:MouseEvent) : void
        {
            var _loc_2:* = this._cellData.data as ItemData;
            ItemClickToolTipUtil.showClickToolTip(event.stageX, event.stageY, _loc_2);
            return;
        }// end function

        private function showPetHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function showRumorPetHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function applyToTeamHandler(event:MouseEvent) : void
        {
            var _loc_2:* = this._cellData.data["copyCode"] as int;
            var _loc_3:* = this._cellData.data["miniPlayer"] as SMiniPlayer;
            return;
        }// end function

        private function cornucopiaBlessHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function jewelAdvanceHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function goToGuildBossHandler(event:MouseEvent) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.Guild_copy_enter));
            return;
        }// end function

        private function onClickIWantSignUpHandler(event:MouseEvent) : void
        {
            var _loc_2:* = Cache.instance.role.roleEntityInfo.entityInfo.entityId;
            var _loc_3:* = this._cellData.data.entityId as SEntityId;
            var _loc_4:* = int(this._cellData.data.copyCode);
            var _loc_5:Object = {copyCode:_loc_4, entityId:_loc_3};
            Dispatcher.dispatchEvent(new DataEvent(EventName.CopyGroupApplyByBrocast, _loc_5));
            return;
        }// end function

        private function goToGuildRobCityOneCopyHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function goToGuildElite(event:MouseEvent) : void
        {
            return;
        }// end function

        private function enterGuildGroup(event:MouseEvent) : void
        {
            return;
        }// end function

        private function enterGuildAltarHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function enterGuildPastureHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function enterGuildDefenseHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function showExpdiceHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function openUIHandler(event:MouseEvent) : void
        {
            return;
        }// end function

        private function onClickMarketQickBuy(event:MouseEvent) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.MarketClickQickBuy, this._cellData.data));
            return;
        }// end function

        private function onClickWatchVideo(event:MouseEvent) : void
        {
            return;
        }// end function

        private function onClicIslandpos(event:MouseEvent) : void
        {
            return;
        }// end function

        private function onClickGuildTaskGet(event:MouseEvent) : void
        {
            var _loc_2:* = int(this._cellData.data);
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildTaskFlyToGetShareTask, false));
            return;
        }// end function

        private function onClickGuildTaskAskShare(event:MouseEvent) : void
        {
            var _loc_2:* = int(this._cellData.data);
            Dispatcher.dispatchEvent(new DataEvent(EventName.TaskGuildAskShareTask, _loc_2));
            return;
        }// end function

        private function onClickOpenUI(event:MouseEvent) : void
        {
            var _loc_2:* = this._cellData.data.toString();
            switch(_loc_2)
            {
                case "guildSkill":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Guild_school_open));
                    break;
                }
                case "Recharge":
                {
                    GameUtil.gotoRecharge(ModuleTypeConst.Brocast);
                    break;
                }
                case "Challenge":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ChallengeCopyOpen));
                    break;
                }
                case "Question":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyQuestionOpenEnter));
                    break;
                }
                case "firstRecharge":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FirstRechargeWinOpen));
                    break;
                }
                case "SunBath":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SunbathCopyEnterViewShow));
                    break;
                }
                case "gotoWineParty":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.WinePartyEnterCopy));
                    break;
                }
                case "tianDiRank":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.TianDiRankOpenModule));
                    break;
                }
                case "gotoGarden":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildGotoGarden));
                    break;
                }
                case "GuildDefenseCopy":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildDefenseWinOpen, null));
                    break;
                }
                case "Achieve":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.AchievementOpenPageByOther, null));
                    break;
                }
                case "Exchange":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SignUpOpenWinAndSwitchTag, SignUpConst.Tag_Collect_Exchange));
                    break;
                }
                case "maincitybattle":
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MainCityModuleOpenCurEnterPage));
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        private function onClickOBBattle(event:MouseEvent) : void
        {
            var _loc_2:* = this._cellData.data.toString();
            CopyUtil.copyCheck(this.obBattle, _loc_2);
            return;
        }// end function

        private function obBattle(param1:int) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.BattleRequestOB, param1));
            return;
        }// end function

        private function onClickBattleByGuild(event:MouseEvent) : void
        {
            CopyUtil.copyCheck(this.battleReplyByGuild, this._cellData.data);
            return;
        }// end function

        private function battleReplyByGuild(param1) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.BattleGuildReply, param1));
            return;
        }// end function

        private function closeTootipHandler(event:MouseEvent) : void
        {
            if (_spTooltipContainer && _spTooltipContainer.parent)
            {
                _spTooltipContainer.parent.removeChild(_spTooltipContainer);
            }
            return;
        }// end function

        private function resetToolTipPosition() : void
        {
            if (_spTooltipContainer.x > Global.stage.stageWidth - _spTooltipContainer.width - 6)
            {
                _spTooltipContainer.x = _spTooltipContainer.x - _spTooltipContainer.width - 6;
            }
            var _loc_1:int = 1;
            _spTooltipContainer.y = _spTooltipContainer.y - _spTooltipContainer.height - 6;
            if (_spTooltipContainer.y < 0)
            {
                _spTooltipContainer.y = 0;
            }
            return;
        }// end function

        public function get cellData() : ChatCellData
        {
            return this._cellData;
        }// end function

        public function set cellData(param1:ChatCellData) : void
        {
            this._cellData = param1;
            return;
        }// end function

        public function get cellContentElement() : ContentElement
        {
            return this._cellContentElement;
        }// end function

        public function dispose() : void
        {
            this._cellContentElement = null;
            this._elementFormat = null;
            this._dipatcher = null;
            this._cellData.dispose();
            this._cellData = null;
            if (this._swfPlayer)
            {
                this._swfPlayer.dispose();
                this._swfPlayer = null;
            }
            ObjectPool.disposeObject(this);
            return;
        }// end function

    }
}
